package views

import (
	"errors"
	"fanqiechaodan-blog/common"
	"fanqiechaodan-blog/service"
	"go.uber.org/zap"
	"net/http"
)

func (*HTMLApi) Pigeonhole(writer http.ResponseWriter, request *http.Request) {
	pigeonhole := common.Template.Pigeonhole
	res, err := service.FindPostPigeonhole()
	if err != nil {
		zap.S().Errorf("归档失败;原因:%s", err.Error())
		pigeonhole.WriteError(writer, errors.New("归档失败"))
		return
	}
	pigeonhole.WriteData(writer, res)
}
